import java.util.Scanner;

/**
 * Created by pc on 3/20/16.
 */

class CashCard {
    private String number;
    private int balance;
    private int bonus;
    CashCard(String number, int balance, int bonus) {
        this.number = number;
        this.balance = balance;
        this.bonus = bonus;
    }

    void store(int money) {
        if (money > 0) {
            this.balance += balance;
            if (money >= 1000) {
                this.bonus ++;
            }
        } else {
            System.out.printf("Storage is negative. Are you kidding?");
        }
    }

    void charge(int money) {
        if (money > 0) {
            if (money <= this.balance) {
                this.balance -= money;
            } else {
                System.out.println("Money is not enough!");
            }
        } else {
            System.out.println("Subtracting a negative number. This is to store? ");
        }
    }

    int exchange(int bonus) {
        if (bonus > 0) {
            this.bonus -= bonus;
        }
        return this.bonus;
    }

    int getBalance() {
        return balance;
    }
    int getBonus() {
        return bonus;
    }
    String getNumber() {
        return number;
    }

}

public class CashApp {
    public static void main(String[] args) {
        CashCard[] cards = {
                new CashCard("A001", 500, 0),
                new CashCard("A002", 300, 0),
                new CashCard("A003", 1000, 1),
                new CashCard("A004", 2000, 2),
                new CashCard("A005", 3000, 3)
        };

        Scanner scanner = new Scanner(System.in);
        for (CashCard card : cards) {
            System.out.printf("store for (%s, %d, %d):", card.getNumber(), card.getBalance(), card.getBonus());
            card.store(scanner.nextInt());
            System.out.printf("details (%s, %d, %d)%n", card.getNumber(), card.getBalance(), card.getBonus());
        }
    }
}
